#ifndef __SQL_H__
#define __SQL_H__
#pragma once
#include "head.hpp"
#define STR_LEN 12
struct node
{
    char path[30];
    node *next;
};
int sql_connect(MYSQL **conn);
int find_name(MYSQL *conn, char *name, char *);
void get_salt(char *str);
void add_user(MYSQL *conn, char *name, char *salt, char *mima);
int math_user(MYSQL *conn, char *name, char *password, char *token);
int math_token(MYSQL *conn, char *name, char *token);
void ls_func(MYSQL *conn, char *name, int code, char *buf);
int operate_func(MYSQL *conn, Train_t *ptrain, QUR_msg *pqq_msg, char *name, int *pcode);
void Llog(MYSQL *conn, const char *action, const char *name, const char *ip, const char *result);
void Olog(MYSQL *conn, const char *name, const char *handel, const char *object, const char *result);
#endif